package InnerClass;

public class Car {
    String carName;
    int carAge;
    String carColor;

    public void show(Car this){
        //是打印调用车的名字：宾利
        System.out.println("carName");
        //外部类访问内部类成员，要创建对象才能访问
        Engine e=new Engine();
        System.out.println("engineName");

    }

    //内部类
    class Engine{
        String engineName;
        int engineAge;

        public void show(){
            System.out.println(engineName);
            System.out.println(carName);//内部类可以访问外部类成员，包括私有
        }
    }
}
